
{% extends 'TopxiaAdminBundle::layout.html.twig' %} 

{% set menu = 'admin_course_learningcard'  %}

{% block main %}
{{ web_macro.flash_messages() }}

<form novalidate="" method="get" action="/admin/learningcard/build" class="form-inline" >
      <div class="form-group">
        <input type="text" value="" name="num" placeholder="数量" required class="form-control" style="max-width:80px;">
      </div>
      <div class="form-group">
        <input type="text" value="" name="usetime" placeholder="充值有效期（月）" required class="form-control" style="max-width:135px;">
      </div>
       <div class="form-group">
        <input type="text" value="" name="valid" placeholder="充值后使用有效期（月）" required class="form-control" style="max-width:175px;">
      </div>
      <div class="form-group">
        <input type="text" value="" name="money" placeholder="面额" required class="form-control" style="max-width:60px;">
      </div>
      <div class="form-group">
        <input type="text" value="" name="title" placeholder="学习卡名称" required class="form-control" style="max-width:100px;">
      </div>
      <div class="form-group">
        <select name="type" class="form-control" style="max-width:150px;">
          <option value="">学习卡类型</option>
            <option value="book">book</option>
            <option value="card">card</option>
        </select>
      </div>
       <div class="form-group">
        <select name="cateId" class="form-control" style="max-width:150px;">
          <option >适用范围</option>
          <option value="0">通用</option>

          {% for re in res %}
          <option value="{{ re.id }}">{{ re.name }}</option>
          {% endfor %}
        </select>
          
      </div>
      <div class="form-group">
        <select name="category" class="form-control" style="max-width:150px;">
          <option value="">学习卡分类</option>
            <option value="0">通用</option>
            <option value="1">班级</option>
            <option value="3">视频课程</option>
          <option value="6">考试题库</option>  
        </select>
      </div>
      <div class="form-group">
        <input type="text"  name="batch" readonly  value="{{ (maxbatch+1)|default(1) }}" required="required" class="form-control" style="max-width:50px;">

      </div>

           <button class="btn btn-primary">生成学习卡</button>
    <span class="btn btn-primary">现已有<span style="color:red;font-size:16px;"> {{ maxbatch|default(0) }} </span>批次</span>
          
    </form>
<div class="well well-sm mtl">
    <form novalidate="" method="get" action="/admin/learningcard/detail" class="form-inline" id="activema-search-form">
     
       <div class="form-group">
		<input type="text" value="" name="cardId" placeholder="学习卡号" class="form-control" style="max-width:200px;" required> 
        <input type="text" value="" name="batch" placeholder="批次" class="form-control" style="max-width:60px;" required>
      </div>
     
   
      <button class="btn btn-primary">搜索</button>

    </form>

</div>





<table class="table table-hover" id="category-table">
  <thead>
    <tr>
      <th >批次</th> 
      <th >面额</th> 
      <th >标题</th> 
      <th >学习卡分类</th> 
     
      <th>查看</th>
      <th>操作</th>

      
    </tr>
  </thead>


  {% for res1 in res1%}
    <tr>
      <td>{{ res1.batch }}</td>
      
      <td>{{ res1.deno }}</td>
      <td>{{ res1.title }}</td>
      <td>{% if res1.category == '0' %}通用{% endif %}
      {% if res1.category == '1' %}班级{% endif %}
      {% if res1.category == '3' %}视频课程{% endif %}
      {% if res1.category == '6' %}考试题库{% endif %}

      </td>
     
      <td><a href="{{ path('admin_learningcard_detail', {batch:res1.batch}) }}">详情</a></td>
      <td><a href="{{ path('admin_learningcard_excel', {batch:res1.batch}) }}">导出</a></td>
      
    </tr>

  {% endfor %}

</table> 
<tr><td colspan="15"><div style="padding:0px;" class="empty">共：<span style="color:red">{{anum}}</span>个&#12288;&#12288;&#12288;&#12288;已充值：<span style="color:red">{{ czNum }}</span>个&#12288;&#12288;&#12288;&#12288;未充值：<span style="color:red">{{ anum-czNum }}</span>个</div></td></tr>
<div class="well well-sm mtl">
    <form novalidate="" method="get" action="/admin/learningcard/search" class="form-inline" id="activema-search-form">
     
       <div class="form-group">
        <input type="text" value="{{ nbatch|default( ) }}" name="nbatch" placeholder="请输入批次,多个批次号用逗号隔开" class="form-control" style="width:240px;" required>
      </div>
     
   
      <button class="btn btn-primary">搜索已充值的学习卡</button>
<span >现已有<span style="color:red;font-size:16px;"> {{ cNum|default(0) }} </span>张学习卡已充值</span><span >  &nbsp; &nbsp; &nbsp; &nbsp;现已有<span style="color:red;font-size:16px;"> {{ noNum|default(0) }} </span>张学习卡未充值</span>
    </form>
    
</div>
{#{{ web_macro.paginator(paginator) }}#}
{% endblock %}